package com.io.nio2;

import java.util.Scanner;

/**
 * @author hjj
 * @create 2019-11-24 19:52
 */
public class Demo {
    public static void main(String[] args) {
        try {
            NIOServer.start();
            Thread.sleep(1000);
            NIOClient.start();
            while (true){
                System.out.println("enter what you want to send: ");
                Scanner scanner = new Scanner(System.in);
                String msg = scanner.nextLine();
                NIOClient.sendMsg(msg);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
